package com.data.JVM.chapter08;

/**
 * 单分派与多分派的测试
 */
public class Dispatch {

    static  class QQ{}
    static class _360{}


    public static class Father{
        public void hardChoice(QQ arg){
            System.out.println("Father  choice QQ");
        }
        public void hardChoice(_360 arg){
            System.out.println("Father  choice QQ");
        }




    }

    public static class Son extends Father{
        public void hardChoice(QQ arg){
            System.out.println("Son  choice QQ");
        }
        public void hardChoice(_360 arg){
            System.out.println("Son  choice QQ");
        }
    }

    public static void main(String[] args) {
        Father father = new Father();
        Father son = new Son();

        father.hardChoice(new _360());
        son.hardChoice(new QQ());
    }
}
